package test.maven;

import java.io.File;

public class LastUpdated {
	
	public static void main(String[] args) {
		String path = "F:\\repository";
		File dir = new File(path);
		recur(dir);
	}
	
	static void recur(File dir) {
		File[] files = dir.listFiles();
		for(File file : files) {
			if(file.isDirectory()) {
				recur(file);
			} else {
				String fileName = file.getName();
				int index = fileName.lastIndexOf(".");
				String suffix = fileName.substring(index, fileName.length());
				if(suffix.equals(".lastUpdated")) {
					file.delete();
					System.out.println(fileName+"被删除！！");
				}
			}
		}
	}

}
